<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class HkForecast extends Model
{


    //id搜索器
    public function searchIdAttr($query, $value)
    {
        return $value ? $query->where('id', $value) : '';
    }

    //start_issue 搜索器
    public function searchStartIssueAttr($query, $value)
    {
        return $value ? $query->where('start_issue',$value) : '';
    }
    //end_issue 搜索器
    public function searchEndIssueAttr($query, $value)
    {
        return $value ? $query->where('end_issue', $value) : '';
    }
    //forecast_content 搜索器
    public function searchForecastContentAttr($query, $value)
    {
        return $value ? $query->where('forecast_content', $value) : '';
    }

    //forecast_content 搜索器
    public function searchForecastTypeAttr($query, $value)
    {
        return $value ? $query->where('forecast_type', $value) : '';
    }


    //iswin 搜索器
    public function searchIswinAttr($query, $value)
    {
        return $value ? $query->where('iswin', $value) : '';
    }

    //iswin 获取器
    public function getIswinAttr($value) {

        $status = [
            '等开'=>'等开,color:#ffa200',
            '中'=>'中,color:#e82f2f',
            '错'=>'错,color:#1bd357',
        ];
        $status = explode(',',$status[$value]);
        return $status;
    }

    //forecast_type 获取器
    public function getForecastTypeAttr($value) {

        $status = [
            1=>'平特1肖',
            2=>'特码大小',
            3=>'特码单双',
            4=>'特码24码',
        ];
        return $status[$value];
    }

}
